//
//  CustModel.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/5/27.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "CustModel.h"
#import "StringTool.h"
#import "API.h"

//#define ImgeForwardUrl2 @"http://files.wgfcdn.com/"
@implementation CustModel

-(instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        
        self.consumerId = [NSString stringWithFormat:@"%@",dict[@"consumerId"]];
        self.realname = dict[@"realname"];
       
        if (![StringTool isBlankString:dict[@"avatar"]]) {
            self.avatar = [API videoUrlMake:dict[@"avatar"]];
        }else
        {
            self.avatar = @"";
        }
        
        self.mobile = dict[@"mobile"];
        self.mail = dict[@"mail"];
        self.tel = dict[@"tel"];
        self.city = [NSString stringWithFormat:@"%@",dict[@"state"]];
        self.cityName = dict[@"stateName"];
        self.area = [NSString stringWithFormat:@"%@",dict[@"city"]];
        self.areaName = dict[@"cityName"];
        
        self.address = dict[@"address"];
        self.validate = [NSString stringWithFormat:@"%@",dict[@"validate"]];
        self.validateName = dict[@"validateName"];
        
        self.sex = [NSString stringWithFormat:@"%@",dict[@"sex"]];
        self.sexName = dict[@"sexName"];
        self.birthday = dict[@"birthday"];
        self.account = dict[@"account"];
        self.detailId = [NSString stringWithFormat:@"%@",dict[@"detailId"]];
            
        
    }
    return self;
}

+(instancetype)custModelWithDict:(NSDictionary *)dict
{
    return [[self alloc]initWithDict:dict];
}
@end
